<template>
  <div>
    <read-excel :on-success="readExcel" :max-size="10"></read-excel>
    <my-table-auto :columns="columns" :data="dataList"></my-table-auto>

  </div>
</template>

<script>
  import MyTableAuto from '../../../common/my-table-auto'
  import ReadExcel from '../../../common/others/read-excel'

  export default {
    name: 'index',
    components: { ReadExcel, MyTableAuto  },
    data(){
      return{
        columns: [
          {
            prop: 'col1',
            label: '字段1'
          },{
            prop: 'col2',
            label: '字段2'
          },{
            prop: 'col3',
            label: '字段3'
          },{
            prop: 'col4',
            label: '字段4'
          }, {
            prop: 'col5',
            label: '字段5'
          }
        ],
        dataList: []
      }
    },
    methods: {
      readExcel({results, header}){
        console.log(results)
        this.dataList = results;
      }
    }
  }
</script>

<style scoped>

</style>
